package br.com.naybee.framework.client.connection;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Properties;

import org.springframework.stereotype.Service;

@Service
public final class PropertiesNaybee {

	private Properties propsProperties = new Properties();

	public PropertiesNaybee() {
		FileInputStream file = null;
		try {
			file = new FileInputStream("./properties/configuracao-banco.properties");
			propsProperties.load(file);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	private String getConfig(String config) {
		return propsProperties.getProperty(config);
	}

	public String getHost() {
		return getConfig("config.host");
	}

	public String getBanco() {
		return getConfig("config.banco");
	}

	public String getUsuario() {
		return getConfig("config.usuario");
	}

	public String getSenha() {
		return getConfig("config.senha");
	}

	public String getDriver() {
		return getConfig("config.driver");
	}

	public String getUrl() {
		return getConfig("config.url");
	}

}
